package com.tulele.vtool.service.impl;

import com.tulele.vtool.mapper.HeadBgImgInfoMapper;
import com.tulele.vtool.model.HeadBgImgInfo;
import com.tulele.vtool.service.HeadBgImgInfoService;
import com.tulele.vtool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HeadBgImgInfoServiceImpl implements HeadBgImgInfoService {

    @Autowired
    private HeadBgImgInfoMapper headBgImgInfoMapper;

    @Override
    public List<HeadBgImgInfo> selectHeadBgImg(HeadBgImgInfo headBgImgInfo) {
        return this.headBgImgInfoMapper.selectHeadBgImg(headBgImgInfo);
    }

    @Override
    public void addHeadBgImg(HeadBgImgInfo headBgImgInfo) {
        headBgImgInfo.setId(null);
        headBgImgInfo.setCreateTime(DateUtil.getCurDate());
        headBgImgInfo.setModifyTime(headBgImgInfo.getCreateTime());
        this.headBgImgInfoMapper.addHeadBgImg(headBgImgInfo);
    }
}
